/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('eflo-cnp', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DataResultsTaskIndividualResultMapValue = {
  experimentId?: long(name='ExperimentId', example='54'),
  hostname?: string(name='Hostname', example='p-jt-waf-app1'),
  podName?: string(name='PodName', example='fluxserv-6fc89b45cf-w8wq6'),
  gpuNum?: int32(name='GpuNum', example='8'),
  gpuName?: string(name='GpuName', example='8x OAM 810 GPU'),
  warningFlag?: boolean(name='WarningFlag', example='false'),
  warningMsg?: string(name='WarningMsg'),
  errorFlag?: boolean(name='ErrorFlag', example='false'),
  errorMsg?: string(name='ErrorMsg'),
  tflops?: double(name='Tflops', description='TFLOPS', example='45'),
  samplesPerSecond?: double(name='SamplesPerSecond', example='23'),
}

model ChangeResourceGroupRequest {
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group id.

This parameter is required.', example='rg-aek25k3b4pbhc4a'),
  resourceId?: string(name='ResourceId', description='The resource id.

This parameter is required.', example='123'),
  resourceType?: string(name='ResourceType', description='The resource type.', example='ExperimentPlan'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='Request Id', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary 资源转组
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 资源转组
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CreateExperimentPlanRequest {
  externalParams?: map[string]any(name='ExternalParams', description='Additional parameters', example='{}'),
  resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aekzij65sf2rr5i'),
  resourceId?: long(name='ResourceId', description='Resource ID', example='189'),
  templateId?: long(name='TemplateId', description='Template ID', example='349623'),
}

model CreateExperimentPlanShrinkRequest {
  externalParamsShrink?: string(name='ExternalParams', description='Additional parameters', example='{}'),
  resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-aekzij65sf2rr5i'),
  resourceId?: long(name='ResourceId', description='Resource ID', example='189'),
  templateId?: long(name='TemplateId', description='Template ID', example='349623'),
}

model CreateExperimentPlanResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access denied information', example='{}'),
  data?: long(name='Data', description='Data', example='[]'),
  requestId?: string(name='RequestId', description='Request ID', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', description='Total count of the query', example='0'),
}

model CreateExperimentPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentPlanResponseBody(name='body'),
}

/**
 * @summary Create Experiment Plan
 *
 * @param tmpReq CreateExperimentPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentPlanResponse
 */
async function createExperimentPlanWithOptions(tmpReq: CreateExperimentPlanRequest, runtime: Util.RuntimeOptions): CreateExperimentPlanResponse {
  Util.validateModel(tmpReq);
  var request = new CreateExperimentPlanShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.externalParams)) {
    request.externalParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.externalParams, 'ExternalParams', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.externalParamsShrink)) {
    query['ExternalParams'] = request.externalParamsShrink;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentPlan',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create Experiment Plan
 *
 * @param request CreateExperimentPlanRequest
 * @return CreateExperimentPlanResponse
 */
async function createExperimentPlan(request: CreateExperimentPlanRequest): CreateExperimentPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createExperimentPlanWithOptions(request, runtime);
}

model CreateExperimentPlanTemplateRequest {
  privacyLevel?: string(name='PrivacyLevel', example='private'),
  templateDescription?: string(name='TemplateDescription', example='The template installs jdk and tomcat on a new ECS instance.'),
  templateId?: long(name='TemplateId', example='4724'),
  templateName?: string(name='TemplateName'),
  templatePipeline?: [ 
    {
      envParams?: {
        cpuPerWorker?: int32(name='CpuPerWorker', example='90'),
        cudaVersion?: string(name='CudaVersion', description='cudaVersion', example='1.0.0'),
        gpuDriverVersion?: string(name='GpuDriverVersion', description='GpuDriverVersion', example='1.0.0'),
        gpuPerWorker?: int32(name='GpuPerWorker', example='8'),
        memoryPerWorker?: int32(name='MemoryPerWorker', example='500'),
        NCCLVersion?: string(name='NCCLVersion', description='NCCLVersion', example='1.0.0'),
        pyTorchVersion?: string(name='PyTorchVersion', description='PyTorchVersion', example='1.0.0'),
        shareMemory?: int32(name='ShareMemory', example='500'),
        workerNum?: int32(name='WorkerNum', example='1'),
      }(name='EnvParams'),
      pipelineOrder?: int32(name='PipelineOrder', example='1'),
      scene?: string(name='Scene', example='baseline'),
      settingParams?: map[string]string(name='SettingParams'),
      workloadId?: long(name='WorkloadId', example='14'),
      workloadName?: string(name='WorkloadName', example='test'),
    }
  ](name='TemplatePipeline'),
}

model CreateExperimentPlanTemplateShrinkRequest {
  privacyLevel?: string(name='PrivacyLevel', example='private'),
  templateDescription?: string(name='TemplateDescription', example='The template installs jdk and tomcat on a new ECS instance.'),
  templateId?: long(name='TemplateId', example='4724'),
  templateName?: string(name='TemplateName'),
  templatePipelineShrink?: string(name='TemplatePipeline'),
}

model CreateExperimentPlanTemplateResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: {
    createTime?: string(name='CreateTime', example='2024-11-19T02:01:05Z'),
    creatorUid?: long(name='CreatorUid', example='12312312312312'),
    isDelete?: int32(name='IsDelete', example='0'),
    privacyLevel?: string(name='PrivacyLevel', example='private'),
    templateDescription?: string(name='TemplateDescription'),
    templateId?: long(name='TemplateId', example='17615126'),
    templateName?: string(name='TemplateName'),
    templatePipelineParam?: [ 
      {
        envParams?: {
          cpuPerWorker?: int32(name='CpuPerWorker', example='90'),
          cudaVersion?: string(name='CudaVersion', description='cudaVersion', example='1.0.0'),
          gpuDriverVersion?: string(name='GpuDriverVersion', description='GpuDriverVersion', example='1.0.0'),
          gpuPerWorker?: int32(name='GpuPerWorker', example='8'),
          memoryPerWorker?: int32(name='MemoryPerWorker', example='500'),
          NCCLVersion?: string(name='NCCLVersion', description='NCCLVersion', example='1.0.0'),
          pyTorchVersion?: string(name='PyTorchVersion', description='PyTorchVersion', example='1.0.0'),
          shareMemory?: int32(name='ShareMemory', example='500'),
          workerNum?: int32(name='WorkerNum', example='1'),
        }(name='EnvParams'),
        pipelineOrder?: int32(name='PipelineOrder', example='1'),
        scene?: string(name='Scene', example='baseline'),
        settingParams?: map[string]string(name='SettingParams'),
        workloadId?: long(name='WorkloadId', example='13'),
        workloadName?: string(name='WorkloadName', example='test'),
      }
    ](name='TemplatePipelineParam'),
    updateTime?: string(name='UpdateTime', example='2023-10-16T01:58Z'),
    versionId?: long(name='VersionId', example='1'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', example='0'),
}

model CreateExperimentPlanTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentPlanTemplateResponseBody(name='body'),
}

/**
 * @summary 创建/更新测试计划模板
 *
 * @param tmpReq CreateExperimentPlanTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentPlanTemplateResponse
 */
async function createExperimentPlanTemplateWithOptions(tmpReq: CreateExperimentPlanTemplateRequest, runtime: Util.RuntimeOptions): CreateExperimentPlanTemplateResponse {
  Util.validateModel(tmpReq);
  var request = new CreateExperimentPlanTemplateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.templatePipeline)) {
    request.templatePipelineShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.templatePipeline, 'TemplatePipeline', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.privacyLevel)) {
    query['PrivacyLevel'] = request.privacyLevel;
  }
  if (!Util.isUnset(request.templateDescription)) {
    query['TemplateDescription'] = request.templateDescription;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.templatePipelineShrink)) {
    body['TemplatePipeline'] = request.templatePipelineShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentPlanTemplate',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建/更新测试计划模板
 *
 * @param request CreateExperimentPlanTemplateRequest
 * @return CreateExperimentPlanTemplateResponse
 */
async function createExperimentPlanTemplate(request: CreateExperimentPlanTemplateRequest): CreateExperimentPlanTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createExperimentPlanTemplateWithOptions(request, runtime);
}

model CreateResourceRequest {
  clusterDesc?: string(name='ClusterDesc', description='Cluster Description', example='ppu集群'),
  clusterId?: string(name='ClusterId', description='Cluster ID', example='ehpc-sh-fj71c0ycfw'),
  clusterName?: string(name='ClusterName', description='Cluster Name', example='tre-1-ppu'),
  clusterType?: string(name='ClusterType', description='Cluster Type', example='ACK'),
  machineTypes?: {
    bondNum?: int32(name='BondNum', description='Number of Network Bonds', example='5'),
    cpuInfo?: string(name='CpuInfo', description='CPU Information', example='2x Intel Saphhire Rapid 8469C 48C CPU'),
    diskInfo?: string(name='DiskInfo', description='Disk Information', example='2x 480GB SATA SSD \\\\n 4x 3.84TB NVMe SSD'),
    gpuInfo?: string(name='GpuInfo', description='GPU Information', example='8x NVIDIA SXM4 80GB A100 GPU'),
    memoryInfo?: string(name='MemoryInfo', description='Memory Information', example='32x 64GB DDR4 4800 Memory'),
    name?: string(name='Name', description='Specification Name', example='efg1.nvga1n'),
    networkInfo?: string(name='NetworkInfo', description='Network Information', example='1x 200Gbps Dual Port BF3 DPU for VPC\\\\\\\\n4x 200Gbps Dual Port EIC'),
    networkMode?: string(name='NetworkMode', description='Network Mode', example='2'),
    nodeCount?: int32(name='NodeCount', description='Number of Nodes', example='1'),
    type?: string(name='Type', description='Type', example='Private'),
  }(name='MachineTypes', description='Machine Types'),
  resourceType?: string(name='ResourceType', description='Resource Type', example='ACK'),
  userAccessParam?: {
    accessId?: string(name='AccessId', description='User ID', example='dev'),
    accessKey?: string(name='AccessKey', description='User Key', example='test'),
    endpoint?: string(name='Endpoint', description='Endpoint', example='test'),
    workspaceId?: string(name='WorkspaceId', description='Workspace ID', example='1245688643'),
  }(name='UserAccessParam', description='User Access Parameters'),
}

model CreateResourceShrinkRequest {
  clusterDesc?: string(name='ClusterDesc', description='Cluster Description', example='ppu集群'),
  clusterId?: string(name='ClusterId', description='Cluster ID', example='ehpc-sh-fj71c0ycfw'),
  clusterName?: string(name='ClusterName', description='Cluster Name', example='tre-1-ppu'),
  clusterType?: string(name='ClusterType', description='Cluster Type', example='ACK'),
  machineTypesShrink?: string(name='MachineTypes', description='Machine Types'),
  resourceType?: string(name='ResourceType', description='Resource Type', example='ACK'),
  userAccessParamShrink?: string(name='UserAccessParam', description='User Access Parameters'),
}

model CreateResourceResponseBody = {
  data?: long(name='Data', description='Data', example='[]'),
  requestId?: string(name='RequestId', description='Request ID', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', description='Total Count', example='0'),
}

model CreateResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceResponseBody(name='body'),
}

/**
 * @summary Create Evaluation Resource
 *
 * @param tmpReq CreateResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceResponse
 */
async function createResourceWithOptions(tmpReq: CreateResourceRequest, runtime: Util.RuntimeOptions): CreateResourceResponse {
  Util.validateModel(tmpReq);
  var request = new CreateResourceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.machineTypes)) {
    request.machineTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.machineTypes, 'MachineTypes', 'json');
  }
  if (!Util.isUnset(tmpReq.userAccessParam)) {
    request.userAccessParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userAccessParam, 'UserAccessParam', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clusterDesc)) {
    query['ClusterDesc'] = request.clusterDesc;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.clusterName)) {
    query['ClusterName'] = request.clusterName;
  }
  if (!Util.isUnset(request.clusterType)) {
    query['ClusterType'] = request.clusterType;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.machineTypesShrink)) {
    body['MachineTypes'] = request.machineTypesShrink;
  }
  if (!Util.isUnset(request.userAccessParamShrink)) {
    body['UserAccessParam'] = request.userAccessParamShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateResource',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create Evaluation Resource
 *
 * @param request CreateResourceRequest
 * @return CreateResourceResponse
 */
async function createResource(request: CreateResourceRequest): CreateResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createResourceWithOptions(request, runtime);
}

model DeleteExperimentRequest {
  experimentId?: long(name='ExperimentId', example='234'),
}

model DeleteExperimentResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: boolean(name='Data', example='[]'),
  requestId?: string(name='RequestId', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', example='0'),
}

model DeleteExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentResponseBody(name='body'),
}

/**
 * @summary 删除实验
 *
 * @param request DeleteExperimentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentResponse
 */
async function deleteExperimentWithOptions(request: DeleteExperimentRequest, runtime: Util.RuntimeOptions): DeleteExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperiment',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除实验
 *
 * @param request DeleteExperimentRequest
 * @return DeleteExperimentResponse
 */
async function deleteExperiment(request: DeleteExperimentRequest): DeleteExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteExperimentWithOptions(request, runtime);
}

model DeleteExperimentPlanTemplateRequest {
  templateId?: long(name='TemplateId', example='346527'),
}

model DeleteExperimentPlanTemplateResponseBody = {
  data?: boolean(name='Data', example='[]'),
  requestId?: string(name='RequestId', example='4D3FD55F-3BCD-5914-9B74-A1F4961327E7'),
  totalCount?: long(name='TotalCount', example='0'),
}

model DeleteExperimentPlanTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentPlanTemplateResponseBody(name='body'),
}

/**
 * @summary 删除测试计划模板
 *
 * @param request DeleteExperimentPlanTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentPlanTemplateResponse
 */
async function deleteExperimentPlanTemplateWithOptions(request: DeleteExperimentPlanTemplateRequest, runtime: Util.RuntimeOptions): DeleteExperimentPlanTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperimentPlanTemplate',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除测试计划模板
 *
 * @param request DeleteExperimentPlanTemplateRequest
 * @return DeleteExperimentPlanTemplateResponse
 */
async function deleteExperimentPlanTemplate(request: DeleteExperimentPlanTemplateRequest): DeleteExperimentPlanTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteExperimentPlanTemplateWithOptions(request, runtime);
}

model GetExperimentRequest {
  experimentId?: long(name='ExperimentId', example='234'),
}

model GetExperimentResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: {
    createTime?: long(name='CreateTime', example='2024-11-29 02:16:35'),
    endTime?: string(name='EndTime', example='2024-11-29 02:26:35'),
    envParams?: {
      cpuPerWorker?: int32(name='CpuPerWorker', example='90'),
      cudaVersion?: string(name='CudaVersion', description='cudaVersion', example='1.0.0'),
      extendParam?: map[string]string(name='ExtendParam'),
      gpuDriverVersion?: string(name='GpuDriverVersion', description='GpuDriverVersion', example='1.0.0'),
      gpuPerWorker?: int32(name='GpuPerWorker', example='8'),
      memoryPerWorker?: int32(name='MemoryPerWorker', example='500'),
      NCCLVersion?: string(name='NCCLVersion', description='NCCLVersion', example='1.0.0'),
      pyTorchVersion?: string(name='PyTorchVersion', description='PyTorchVersion', example='1.0.0'),
      resourceNodes?: [ 
        {
          nodeName?: string(name='NodeName', example='p-jt-waf-app1'),
          requestCPU?: int32(name='RequestCPU', example='90'),
          requestGPU?: int32(name='RequestGPU', example='8'),
          requestMemory?: int32(name='RequestMemory', example='500'),
          totalCPU?: int32(name='TotalCPU', example='90'),
          totalGPU?: int32(name='TotalGPU', example='8'),
          totalMemory?: long(name='TotalMemory', example='500'),
        }
      ](name='ResourceNodes'),
      shareMemory?: int32(name='ShareMemory', example='500'),
      workerNum?: int32(name='WorkerNum', example='1'),
    }(name='EnvParams'),
    experimentId?: long(name='ExperimentId', example='1726882991828688898'),
    experimentName?: string(name='ExperimentName', example='test'),
    experimentType?: string(name='ExperimentType', example='AI'),
    getParams?: map[string]string(name='GetParams'),
    resource?: {
      cpuCoreLimit?: int32(name='CpuCoreLimit', example='90'),
      gpuLimit?: int32(name='GpuLimit', example='8'),
      machineType?: {
        bondNum?: int32(name='BondNum', example='5'),
        cpuInfo?: string(name='CpuInfo', example='2x Intel Icelake 8369B 32C CPU'),
        diskInfo?: string(name='DiskInfo', example='2x 480GB SATA SSD \\\\n 4x 3.84TB NVMe SSD'),
        gpuInfo?: string(name='GpuInfo', example='8x NVIDIA SXM4 80GB A100 GPU'),
        memoryInfo?: string(name='MemoryInfo', example='32x 64GB DDR4 3200 Memory'),
        name?: string(name='Name', example='efg1.nvga1n'),
        networkInfo?: string(name='NetworkInfo', example='1x 100Gbps DP NIC for VPC \\\\n 4x 100Gbps DP RoCE NIC'),
        networkMode?: string(name='NetworkMode', example='2'),
        nodeCount?: int32(name='NodeCount', example='1'),
        type?: string(name='Type', example='Public'),
      }(name='MachineType'),
      maxCpuCore?: int32(name='MaxCpuCore', example='90'),
      maxGpu?: int32(name='MaxGpu', example='8'),
      maxMemory?: long(name='MaxMemory', example='500'),
      memoryLimit?: long(name='MemoryLimit', example='500'),
      resourceId?: long(name='ResourceId', example='189'),
      resourceName?: string(name='ResourceName', example='ecs.r8y.4xlarge'),
      resourceNodes?: [ 
        {
          nodeName?: string(name='NodeName', example='InputCheck'),
        }
      ](name='ResourceNodes'),
      userAccessParam?: {
        accessId?: string(name='AccessId', example='dev'),
        accessKey?: string(name='AccessKey', example='test'),
        endpoint?: string(name='Endpoint', description='endpoint', example='test'),
        workspaceId?: string(name='WorkspaceId', example='123434542498'),
      }(name='UserAccessParam'),
    }(name='Resource'),
    resourceName?: string(name='ResourceName', example='cifnews-guoyuan'),
    results?: {
      duration?: double(name='Duration', example='764'),
      errorWorker?: [ 
        {
          errorFlag?: boolean(name='ErrorFlag', example='true'),
          errorMsg?: string(name='ErrorMsg', example='Connection reset'),
          experimentId?: long(name='ExperimentId', example='97'),
          gpuName?: string(name='GpuName', example='8x OAM 810 GPU'),
          gpuNum?: int32(name='GpuNum', example='8'),
          hostname?: string(name='Hostname', example='60.188.98.209'),
          podName?: string(name='PodName', example='hzs-forge-sdxl-online-7ff4d86444-pc95h'),
          samplesPerSecond?: double(name='SamplesPerSecond', example='23'),
          tflops?: double(name='Tflops', example='12'),
          warningFlag?: boolean(name='WarningFlag', example='false'),
          warningMsg?: string(name='WarningMsg'),
        }
      ](name='ErrorWorker'),
      experimentId?: long(name='ExperimentId', example='1748274952976261121'),
      mfu?: double(name='Mfu', description='MFU', example='54.2'),
      samplesPerSecond?: double(name='SamplesPerSecond', example='10'),
      secondsPerIteration?: double(name='SecondsPerIteration', example='1000'),
      taskIndividualResultList?: [ 
        {
          errorFlag?: boolean(name='ErrorFlag', example='false'),
          errorMsg?: string(name='ErrorMsg'),
          experimentId?: long(name='ExperimentId', example='48'),
          gpuName?: string(name='GpuName', example='8x OAM 810 GPU'),
          gpuNum?: int32(name='GpuNum', example='8'),
          hostname?: string(name='Hostname', example='p-jt-waf-app1'),
          podName?: string(name='PodName', example='fluxserv-6fc89b45cf-w8wq6'),
          samplesPerSecond?: double(name='SamplesPerSecond', example='28'),
          tflops?: double(name='Tflops', example='16'),
          warningFlag?: boolean(name='WarningFlag', example='false'),
          warningMsg?: string(name='WarningMsg'),
        }
      ](name='TaskIndividualResultList'),
      taskIndividualResultMap?: map[string][ DataResultsTaskIndividualResultMapValue       ](name='TaskIndividualResultMap'),
      warningBoundList?: [ 
        {
          iteration?: int32(name='Iteration', example='10'),
          lower?: double(name='Lower', description='LOWER', example='14'),
          upper?: double(name='Upper', description='UPPER', example='56'),
        }
      ](name='WarningBoundList'),
      warningWorker?: [ 
        {
          errorFlag?: boolean(name='ErrorFlag', example='true'),
          errorMsg?: string(name='ErrorMsg'),
          experimentId?: long(name='ExperimentId', example='9'),
          gpuName?: string(name='GpuName', example='8x OAM 810 GPU'),
          gpuNum?: int32(name='GpuNum', example='8'),
          hostname?: string(name='Hostname', example='whza008403'),
          podName?: string(name='PodName', example='fluxserv-6fc89b45cf-w8wq6'),
          samplesPerSecond?: double(name='SamplesPerSecond', example='15'),
          tflops?: double(name='Tflops', example='14'),
          warningFlag?: boolean(name='WarningFlag', example='true'),
          warningMsg?: string(name='WarningMsg'),
        }
      ](name='WarningWorker'),
    }(name='Results'),
    setParams?: map[string]string(name='SetParams'),
    startTime?: string(name='StartTime', example='2024-11-29 02:16:35'),
    status?: string(name='Status', example='RUNNING'),
    task?: {
      createTime?: long(name='CreateTime', example='2024-03-05 18:24:08'),
      endTime?: long(name='EndTime', example='2024-03-05 18:34:08'),
      params?: map[string]string(name='Params'),
      scene?: string(name='Scene', example='baseline'),
      startTime?: long(name='StartTime', example='2024-03-05 18:24:08'),
      status?: string(name='Status', example='success'),
      taskId?: long(name='TaskId', example='167420'),
      updateTime?: long(name='UpdateTime', example='2024-03-05 18:24:08'),
    }(name='Task'),
    updateTime?: long(name='UpdateTime', example='2024-11-29 02:16:35'),
    workload?: {
      defaultCpuPerWorker?: int32(name='DefaultCpuPerWorker', example='90'),
      defaultGpuPerWorker?: int32(name='DefaultGpuPerWorker', example='8'),
      defaultMemoryPerWorker?: int32(name='DefaultMemoryPerWorker', example='500'),
      defaultShareMemory?: int32(name='DefaultShareMemory', example='500'),
      family?: string(name='Family', example='AI'),
      jobKind?: string(name='JobKind', example='PyTorchJob'),
      paramSettings?: [ 
        {
          defaultValue?: string(name='DefaultValue', example='100'),
          paramDesc?: string(name='ParamDesc'),
          paramName?: string(name='ParamName', example='ITERATION'),
          paramRegex?: string(name='ParamRegex', example='[0-9]+'),
          paramType?: string(name='ParamType', example='number'),
          paramValue?: string(name='ParamValue', example='100'),
        }
      ](name='ParamSettings'),
      scene?: string(name='Scene', example='NLP-LLM'),
      scope?: string(name='Scope', example='common'),
      staticConfig?: {
        frameWork?: string(name='FrameWork', example='pyTorch'),
        os?: string(name='Os', example='linux'),
        parameters?: string(name='Parameters', example='7B'),
        softwareStack?: string(name='SoftwareStack', example='python'),
      }(name='StaticConfig'),
      versionId?: long(name='VersionId', example='1'),
      workloadDescription?: string(name='WorkloadDescription', example='test'),
      workloadId?: long(name='WorkloadId', example='13'),
      workloadName?: string(name='WorkloadName', example='test'),
      workloadType?: string(name='WorkloadType', example='AI'),
    }(name='Workload'),
    workloadName?: string(name='WorkloadName', example='test'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='E67E2E4C-2B47-5C55-AA17-1D771E070AEF'),
  totalCount?: long(name='TotalCount', example='0'),
}

model GetExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentResponseBody(name='body'),
}

/**
 * @summary 获取实验详情
 *
 * @param request GetExperimentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentResponse
 */
async function getExperimentWithOptions(request: GetExperimentRequest, runtime: Util.RuntimeOptions): GetExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperiment',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验详情
 *
 * @param request GetExperimentRequest
 * @return GetExperimentResponse
 */
async function getExperiment(request: GetExperimentRequest): GetExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExperimentWithOptions(request, runtime);
}

model GetExperimentPlanRequest {
  planId?: long(name='PlanId', description='Plan ID', example='189'),
}

model GetExperimentPlanResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access denied information', example='{}'),
  data?: {
    createTime?: string(name='CreateTime', description='Creation time', example='2024-07-07 02:08:54'),
    planId?: long(name='PlanId', description='Plan ID', example='189'),
    planPipeline?: [ 
      {
        envParams?: {
          cpuPerWorker?: int32(name='CpuPerWorker', description='CPU allocation', example='90'),
          cudaVersion?: string(name='CudaVersion', description='CUDA version', example='1.0.0'),
          extendParam?: map[string]string(name='ExtendParam', description='Additional parameters'),
          gpuDriverVersion?: string(name='GpuDriverVersion', description='GPU driver version', example='1.0.0'),
          gpuPerWorker?: int32(name='GpuPerWorker', description='Number of GPUs allocated', example='8'),
          memoryPerWorker?: int32(name='MemoryPerWorker', description='Memory GB allocation', example='500'),
          NCCLVersion?: string(name='NCCLVersion', description='NCCL version', example='1.0.0'),
          pyTorchVersion?: string(name='PyTorchVersion', description='PyTorch version', example='1.0.0'),
          resourceNodes?: [ 
            {
              nodeName?: string(name='NodeName', description='Node name', example='ods_galaxy_gateway_tickets'),
              requestCPU?: int32(name='RequestCPU', description='Requested CPU', example='90'),
              requestGPU?: int32(name='RequestGPU', description='Requested GPU', example='8'),
              requestMemory?: int32(name='RequestMemory', description='Memory of the current request', example='500'),
              totalCPU?: int32(name='TotalCPU', description='Total CPU', example='90'),
              totalGPU?: int32(name='TotalGPU', description='Total GPU', example='8'),
              totalMemory?: long(name='TotalMemory', description='Total memory', example='500'),
            }
          ](name='ResourceNodes', description='Specified nodes'),
          shareMemory?: int32(name='ShareMemory', description='Shared memory GB allocation', example='500'),
          workerNum?: int32(name='WorkerNum', description='Number of nodes', example='1'),
        }(name='EnvParams', description='Configured environment parameters'),
        pipelineOrder?: int32(name='PipelineOrder', description='Node order number', example='1'),
        resourceId?: long(name='ResourceId', description='Resource ID', example='36'),
        resourceName?: string(name='ResourceName', description='Resource name', example='PPU'),
        scene?: string(name='Scene', description='Usage scenario, e.g., "baseline"', example='baseline'),
        settingParams?: map[string]string(name='SettingParams', description='Configured workload parameters'),
        workloadId?: long(name='WorkloadId', description='Workload ID', example='14'),
        workloadName?: string(name='WorkloadName', description='Workload name', example='test'),
      }
    ](name='PlanPipeline', description='Test plan pipeline'),
    resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID', example='rg-acfmvmpzi7lmxhq'),
    resourceId?: long(name='ResourceId', description='Associated resource ID', example='260860230684'),
    templateId?: long(name='TemplateId', description='Associated test plan template ID', example='2162'),
    templateName?: string(name='TemplateName', description='Associated test plan template name', example='MM'),
    updateTime?: string(name='UpdateTime', description='Update time', example='2024-07-07 02:08:54'),
  }(name='Data', description='Data'),
  requestId?: string(name='RequestId', description='Request ID', example='6DBAC169-93D1-5DCD-8109-30FB623B3197'),
  totalCount?: long(name='TotalCount', description='Total count of the query', example='0'),
}

model GetExperimentPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentPlanResponseBody(name='body'),
}

/**
 * @summary Get Experiment Plan Details
 *
 * @param request GetExperimentPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentPlanResponse
 */
async function getExperimentPlanWithOptions(request: GetExperimentPlanRequest, runtime: Util.RuntimeOptions): GetExperimentPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentPlan',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get Experiment Plan Details
 *
 * @param request GetExperimentPlanRequest
 * @return GetExperimentPlanResponse
 */
async function getExperimentPlan(request: GetExperimentPlanRequest): GetExperimentPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExperimentPlanWithOptions(request, runtime);
}

model GetExperimentResultDataRequest {
  experimentId?: long(name='ExperimentId', example='234'),
  hostname?: string(name='Hostname', example='iZj6ccwd7zwfms7hzaz2riZ'),
  workloadType?: string(name='WorkloadType', example='AI'),
}

model GetExperimentResultDataResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: [ 
    {
      gpuNum?: string(name='GpuNum', example='8'),
      hostname?: string(name='Hostname', example='p-jt-waf-app1'),
      metricsInfos?: [ 
        {
          gpuNum?: string(name='Gpu_num', description='gpu', example='8'),
          iteration?: long(name='Iteration', description='iteration', example='100'),
          tflops?: double(name='Tflops', description='TFLOPS', example='43'),
          timestamp?: long(name='Timestamp', example='1715393860'),
          value?: double(name='Value', example='126'),
        }
      ](name='MetricsInfos'),
      podName?: string(name='PodName', example='hzs-forge-sdxl-online-7ff4d86444-pc95h'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='C1D34EC2-AB13-56F4-8322-F15AE563EA04'),
  totalCount?: long(name='TotalCount', example='0'),
}

model GetExperimentResultDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentResultDataResponseBody(name='body'),
}

/**
 * @summary 获取实验结果数据
 *
 * @param request GetExperimentResultDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentResultDataResponse
 */
async function getExperimentResultDataWithOptions(request: GetExperimentResultDataRequest, runtime: Util.RuntimeOptions): GetExperimentResultDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.hostname)) {
    query['Hostname'] = request.hostname;
  }
  if (!Util.isUnset(request.workloadType)) {
    query['WorkloadType'] = request.workloadType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentResultData',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验结果数据
 *
 * @param request GetExperimentResultDataRequest
 * @return GetExperimentResultDataResponse
 */
async function getExperimentResultData(request: GetExperimentResultDataRequest): GetExperimentResultDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getExperimentResultDataWithOptions(request, runtime);
}

model GetResourceRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID of Lingjun', example='ehpc-bj-uo8f26cpmo'),
}

model GetResourceResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access denied information', example='{}'),
  data?: {
    clusterDesc?: string(name='ClusterDesc', description='Cluster description', example='test'),
    clusterId?: string(name='ClusterId', description='Cluster ID', example='3123121223'),
    clusterName?: string(name='ClusterName', description='Cluster name', example='main_cluster'),
    cpuCoreLimit?: int32(name='CpuCoreLimit', description='Used CPU', example='90'),
    gpuLimit?: int32(name='GpuLimit', description='Used GPU', example='8'),
    machineType?: {
      bondNum?: int32(name='BondNum', description='Number of network bonds', example='5'),
      cpuInfo?: string(name='CpuInfo', description='CPU information', example='2x Intel Saphhire Rapid 8469C 48C CPU'),
      diskInfo?: string(name='DiskInfo', description='Disk information', example='2x 480GB SATA SSD\\\\n4x 3.84TB NVMe SSD'),
      gpuInfo?: string(name='GpuInfo', description='GPU information', example='8x OAM 810 GPU'),
      memoryInfo?: string(name='MemoryInfo', description='Memory information', example='32x 64GB DDR4 4800 Memory'),
      name?: string(name='Name', description='Specification name', example='efg2.p8en'),
      networkInfo?: string(name='NetworkInfo', description='Network information', example='1x 200Gbps Dual Port BF3 DPU for VPC\\\\n4x 200Gbps Dual Port EIC'),
      networkMode?: string(name='NetworkMode', description='Network mode', example='2'),
      nodeCount?: int32(name='NodeCount', description='Number of nodes', example='1'),
      type?: string(name='Type', description='Type', example='Private'),
    }(name='MachineType', description='Machine type'),
    maxCpuCore?: int32(name='MaxCpuCore', description='Used memory', example='90'),
    maxGpu?: int32(name='MaxGpu', description='Used memory', example='8'),
    maxMemory?: long(name='MaxMemory', description='Used memory', example='500'),
    memoryLimit?: long(name='MemoryLimit', description='Used memory', example='500'),
    resourceId?: long(name='ResourceId', description='Cluster ID', example='189'),
    resourceName?: string(name='ResourceName', description='Cluster name', example='ecs.g6.4xlarge'),
    resourceNodes?: [ 
      {
        nodeName?: string(name='NodeName', description='Node name', example='lingj19q90jp66nq-mg2pa0p2l2bipnsi-17'),
      }
    ](name='ResourceNodes', description='List of resource nodes'),
    userAccessParam?: {
      accessId?: string(name='AccessId', description='User ID', example='dev'),
      accessKey?: string(name='AccessKey', description='User key', example='test'),
      endpoint?: string(name='Endpoint', description='Endpoint', example='test'),
      workspaceId?: string(name='WorkspaceId', description='Workspace ID', example='test'),
    }(name='UserAccessParam', description='User authorization parameters'),
  }(name='Data', description='Data'),
  requestId?: string(name='RequestId', description='Request ID', example='25859897-35C8-5015-8365-7A3CE52F4854'),
  totalCount?: long(name='TotalCount', description='Total count of the query', example='0'),
}

model GetResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceResponseBody(name='body'),
}

/**
 * @summary Get Resource Information
 *
 * @param request GetResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceResponse
 */
async function getResourceWithOptions(request: GetResourceRequest, runtime: Util.RuntimeOptions): GetResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResource',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get Resource Information
 *
 * @param request GetResourceRequest
 * @return GetResourceResponse
 */
async function getResource(request: GetResourceRequest): GetResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourceWithOptions(request, runtime);
}

model GetResourcePredictResultRequest {
  resourceId?: long(name='ResourceId', example='36'),
  templateId?: long(name='TemplateId', example='315797'),
}

model GetResourcePredictResultResponseBody = {
  data?: long(name='Data', example='2'),
  requestId?: string(name='RequestId', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', example='1'),
}

model GetResourcePredictResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourcePredictResultResponseBody(name='body'),
}

/**
 * @summary 查询测试计划模板资源预测结果
 *
 * @param request GetResourcePredictResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourcePredictResultResponse
 */
async function getResourcePredictResultWithOptions(request: GetResourcePredictResultRequest, runtime: Util.RuntimeOptions): GetResourcePredictResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourcePredictResult',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询测试计划模板资源预测结果
 *
 * @param request GetResourcePredictResultRequest
 * @return GetResourcePredictResultResponse
 */
async function getResourcePredictResult(request: GetResourcePredictResultRequest): GetResourcePredictResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResourcePredictResultWithOptions(request, runtime);
}

model GetWorkloadRequest {
  workloadId?: long(name='WorkloadId', description='This parameter is required.', example='13'),
}

model GetWorkloadResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: {
    defaultCpuPerWorker?: int32(name='DefaultCpuPerWorker', example='90'),
    defaultGpuPerWorker?: int32(name='DefaultGpuPerWorker', example='8'),
    defaultMemoryPerWorker?: int32(name='DefaultMemoryPerWorker', example='500'),
    defaultShareMemory?: int32(name='DefaultShareMemory', example='500'),
    family?: string(name='Family', example='AI'),
    jobKind?: string(name='JobKind', example='PyTorchJob'),
    paramSettings?: [ 
      {
        defaultValue?: string(name='DefaultValue', example='100'),
        paramDesc?: string(name='ParamDesc'),
        paramName?: string(name='ParamName', example='ITERATION'),
        paramRegex?: string(name='ParamRegex', example='[0-9]+'),
        paramType?: string(name='ParamType', example='number'),
        paramValue?: string(name='ParamValue', example='100'),
      }
    ](name='ParamSettings'),
    scene?: string(name='Scene', example='NLP-LLM'),
    scope?: string(name='Scope', example='common'),
    staticConfig?: {
      frameWork?: string(name='FrameWork', example='PyTorch'),
      os?: string(name='Os', example='linux'),
      parameters?: string(name='Parameters', example='7B'),
      softwareStack?: string(name='SoftwareStack', example='python'),
    }(name='StaticConfig'),
    versionId?: long(name='VersionId', example='1'),
    workloadDescription?: string(name='WorkloadDescription', example='test'),
    workloadId?: long(name='WorkloadId', example='13'),
    workloadName?: string(name='WorkloadName', example='test'),
    workloadType?: string(name='WorkloadType', example='AI'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='E67E2E4C-2B47-5C55-AA17-1D771E070AEF'),
  totalCount?: long(name='TotalCount', example='0'),
}

model GetWorkloadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkloadResponseBody(name='body'),
}

/**
 * @summary 通过id获取负载信息
 *
 * @param request GetWorkloadRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkloadResponse
 */
async function getWorkloadWithOptions(request: GetWorkloadRequest, runtime: Util.RuntimeOptions): GetWorkloadResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.workloadId)) {
    query['WorkloadId'] = request.workloadId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkload',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通过id获取负载信息
 *
 * @param request GetWorkloadRequest
 * @return GetWorkloadResponse
 */
async function getWorkload(request: GetWorkloadRequest): GetWorkloadResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWorkloadWithOptions(request, runtime);
}

model ListExperimentPlanTemplatesRequest {
  privacyLevel?: string(name='PrivacyLevel', description='The sharing level of the template, default is private, options are public and private.', example='private'),
}

model ListExperimentPlanTemplatesResponseBody = {
  data?: [ 
    {
      createTime?: string(name='CreateTime', description='Creation time', example='2024-11-29 02:16:35'),
      creatorUid?: long(name='CreatorUid', description='Primary account UID', example='178154411231232'),
      isDelete?: int32(name='IsDelete', description='Whether it is deleted', example='0'),
      privacyLevel?: string(name='PrivacyLevel', description='Privacy level', example='private'),
      templateDescription?: string(name='TemplateDescription', description='Template description', example='test'),
      templateId?: long(name='TemplateId', description='Template ID', example='17815441'),
      templateName?: string(name='TemplateName', description='Template name', example='test'),
      templatePipelineParam?: [ 
        {
          envParams?: {
            cpuPerWorker?: int32(name='CpuPerWorker', description='CPU allocation', example='90'),
            gpuPerWorker?: int32(name='GpuPerWorker', description='GPU allocation', example='8'),
            memoryPerWorker?: int32(name='MemoryPerWorker', description='Allocated memory in GB', example='500'),
            shareMemory?: int32(name='ShareMemory', description='Allocated shared memory in GB', example='500'),
            workerNum?: int32(name='WorkerNum', description='Number of nodes', example='1'),
          }(name='EnvParams', description='Configured environment parameters'),
          pipelineOrder?: int32(name='PipelineOrder', description='Node sequence number', example='1'),
          scene?: string(name='Scene', description='Usage scenario, e.g., "baseline"', example='baseline'),
          settingParams?: map[string]string(name='SettingParams', description='Configured workload parameters'),
          workloadId?: long(name='WorkloadId', description='Workload ID', example='13'),
          workloadName?: string(name='WorkloadName', description='Workload name', example='test'),
        }
      ](name='TemplatePipelineParam', description='Template pipeline'),
      updateTime?: string(name='UpdateTime', description='Update time', example='2024-11-29 02:16:35'),
      versionId?: long(name='VersionId', description='Version ID', example='1'),
    }
  ](name='Data', description='Data'),
  requestId?: string(name='RequestId', description='Request ID', example='AAE4AFED-7AE6-52FA-80B6-448E63760552'),
  totalCount?: long(name='TotalCount', description='Total', example='0'),
}

model ListExperimentPlanTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentPlanTemplatesResponseBody(name='body'),
}

/**
 * @summary Query Test Plan Template List
 *
 * @param request ListExperimentPlanTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentPlanTemplatesResponse
 */
async function listExperimentPlanTemplatesWithOptions(request: ListExperimentPlanTemplatesRequest, runtime: Util.RuntimeOptions): ListExperimentPlanTemplatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.privacyLevel)) {
    query['PrivacyLevel'] = request.privacyLevel;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperimentPlanTemplates',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query Test Plan Template List
 *
 * @param request ListExperimentPlanTemplatesRequest
 * @return ListExperimentPlanTemplatesResponse
 */
async function listExperimentPlanTemplates(request: ListExperimentPlanTemplatesRequest): ListExperimentPlanTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExperimentPlanTemplatesWithOptions(request, runtime);
}

model ListExperimentPlansRequest {
  creatTimeOrder?: string(name='CreatTimeOrder', description='Creation Time Sorting Rule', example='desc'),
  endTimeOrder?: string(name='EndTimeOrder', description='End Time Sorting Rule', example='desc'),
  page?: int32(name='Page', description='Page Number', example='1'),
  planTaskStatus?: [ string ](name='PlanTaskStatus', description='Execution Status'),
  resourceGroupId?: string(name='ResourceGroupId', description='Resource Group ID', example='rg-aekzij65sf2rr5i'),
  resourceName?: [ string ](name='ResourceName', description='Resource'),
  size?: int32(name='Size', description='Number of Items', example='100'),
  startTimeOrder?: string(name='StartTimeOrder', description='Start Time Sorting Rule', example='desc'),
}

model ListExperimentPlansShrinkRequest {
  creatTimeOrder?: string(name='CreatTimeOrder', description='Creation Time Sorting Rule', example='desc'),
  endTimeOrder?: string(name='EndTimeOrder', description='End Time Sorting Rule', example='desc'),
  page?: int32(name='Page', description='Page Number', example='1'),
  planTaskStatusShrink?: string(name='PlanTaskStatus', description='Execution Status'),
  resourceGroupId?: string(name='ResourceGroupId', description='Resource Group ID', example='rg-aekzij65sf2rr5i'),
  resourceNameShrink?: string(name='ResourceName', description='Resource'),
  size?: int32(name='Size', description='Number of Items', example='100'),
  startTimeOrder?: string(name='StartTimeOrder', description='Start Time Sorting Rule', example='desc'),
}

model ListExperimentPlansResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access Denied Detail', example='{}'),
  data?: [ 
    {
      createTime?: string(name='CreateTime', description='Creation Time', example='2024-07-08 10:12:42'),
      endTime?: string(name='EndTime', description='End Time', example='2024-07-08 10:22:42'),
      planId?: long(name='PlanId', description='Plan ID', example='189'),
      planTaskStatus?: map[string]int32(name='PlanTaskStatus', description='Test Plan Execution Status'),
      resourceGroupId?: string(name='ResourceGroupId', description='Resource Group ID', example='rg-aek5behqmwbfhuy'),
      resourceName?: string(name='ResourceName', description='Associated Resource Name', example='q_ecs_xpec_postpay_c'),
      startTime?: string(name='StartTime', description='Start Time', example='2024-07-08 10:12:42'),
      templateId?: long(name='TemplateId', description='Associated Test Plan Template ID', example='6'),
      templateName?: string(name='TemplateName', description='Associated Test Plan Template Name', example='test'),
      updateTime?: string(name='UpdateTime', description='Update Time', example='2024-07-08 10:12:42'),
    }
  ](name='Data', description='Data'),
  requestId?: string(name='RequestId', description='Request ID', example='FA9F1DE7-103B-5C18-AE9E-EB2BFF11C685'),
  totalCount?: long(name='TotalCount', description='Total', example='0'),
}

model ListExperimentPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentPlansResponseBody(name='body'),
}

/**
 * @summary Query Experiment Plan List
 *
 * @param tmpReq ListExperimentPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentPlansResponse
 */
async function listExperimentPlansWithOptions(tmpReq: ListExperimentPlansRequest, runtime: Util.RuntimeOptions): ListExperimentPlansResponse {
  Util.validateModel(tmpReq);
  var request = new ListExperimentPlansShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.planTaskStatus)) {
    request.planTaskStatusShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.planTaskStatus, 'PlanTaskStatus', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceName)) {
    request.resourceNameShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceName, 'ResourceName', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.creatTimeOrder)) {
    query['CreatTimeOrder'] = request.creatTimeOrder;
  }
  if (!Util.isUnset(request.endTimeOrder)) {
    query['EndTimeOrder'] = request.endTimeOrder;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.startTimeOrder)) {
    query['StartTimeOrder'] = request.startTimeOrder;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.planTaskStatusShrink)) {
    body['PlanTaskStatus'] = request.planTaskStatusShrink;
  }
  if (!Util.isUnset(request.resourceNameShrink)) {
    body['ResourceName'] = request.resourceNameShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListExperimentPlans',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query Experiment Plan List
 *
 * @param request ListExperimentPlansRequest
 * @return ListExperimentPlansResponse
 */
async function listExperimentPlans(request: ListExperimentPlansRequest): ListExperimentPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExperimentPlansWithOptions(request, runtime);
}

model ListExperimentsRequest {
  order?: int32(name='Order', description='Order', example='1'),
  planId?: long(name='PlanId', description='Plan ID', example='189'),
}

model ListExperimentsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access denied information', example='{}'),
  data?: [ 
    {
      createTime?: long(name='CreateTime', description='Creation time', example='2024-10-22 10:18:10'),
      endTime?: string(name='EndTime', description='Task end time', example='2024-10-22 10:28:10'),
      envParams?: {
        cpuPerWorker?: int32(name='CpuPerWorker', description='Number of CPUs allocated', example='90'),
        cudaVersion?: string(name='CudaVersion', description='CUDA version', example='1.0.0'),
        extendParam?: map[string]string(name='ExtendParam', description='Additional parameters'),
        gpuDriverVersion?: string(name='GpuDriverVersion', description='GPU driver version', example='1.0.0'),
        gpuPerWorker?: int32(name='GpuPerWorker', description='Number of GPUs allocated', example='8'),
        memoryPerWorker?: int32(name='MemoryPerWorker', description='Amount of memory (GB) allocated', example='500'),
        NCCLVersion?: string(name='NCCLVersion', description='NCCL version', example='1.0.0'),
        pyTorchVersion?: string(name='PyTorchVersion', description='PyTorch version', example='1.0.0'),
        resourceNodes?: [ 
          {
            nodeName?: string(name='NodeName', description='Node name', example='lingj1xxnjt1k4nv-mg18v52pydyuumae-0'),
            requestCPU?: int32(name='RequestCPU', description='Requested CPU', example='90'),
            requestGPU?: int32(name='RequestGPU', description='Requested GPU', example='8'),
            requestMemory?: int32(name='RequestMemory', description='Requested memory', example='500'),
            totalCPU?: int32(name='TotalCPU', description='Total CPU', example='90'),
            totalGPU?: int32(name='TotalGPU', description='Total GPU', example='8'),
            totalMemory?: long(name='TotalMemory', description='Total memory', example='500'),
          }
        ](name='ResourceNodes', description='Specified nodes'),
        shareMemory?: int32(name='ShareMemory', description='Amount of shared memory (GB) allocated', example='500'),
        workerNum?: int32(name='WorkerNum', description='Number of nodes', example='1'),
      }(name='EnvParams', description='Environment parameters in operation'),
      experimentId?: long(name='ExperimentId', description='Experiment ID', example='1684537476910997506'),
      experimentName?: string(name='ExperimentName', description='Experiment name', example='test'),
      experimentType?: string(name='ExperimentType', description='Experiment type', example='AI'),
      getParams?: map[string]string(name='GetParams', description='Parsed load parameters'),
      resourceName?: string(name='ResourceName', description='Resource name', example='ecs.r8y.4xlarge'),
      results?: {
        duration?: double(name='Duration', description='Duration', example='20'),
        errorWorker?: [ 
          {
            errorFlag?: boolean(name='ErrorFlag', description='Whether there is an error', example='false'),
            errorMsg?: string(name='ErrorMsg', description='Error information', example='error msg'),
            experimentId?: long(name='ExperimentId', description='Experiment ID', example='176'),
            gpuName?: string(name='GpuName', description='GPU name', example='8x OAM 810 GPU'),
            gpuNum?: int32(name='GpuNum', description='Number of GPUs', example='8'),
            hostname?: string(name='Hostname', description='Host IP', example='etcd_cluster_c0n2'),
            podName?: string(name='PodName', description='Pod name', example='fluxserv-6fc89b45cf-w8wq6'),
            samplesPerSecond?: double(name='SamplesPerSecond', description='Throughput', example='65'),
            tflops?: double(name='Tflops', description='TFLOPS value', example='42'),
            warningFlag?: boolean(name='WarningFlag', description='Whether there is an alarm', example='false'),
            warningMsg?: string(name='WarningMsg', description='Alarm information', example='warning msg'),
          }
        ](name='ErrorWorker', description='Error nodes'),
        experimentId?: long(name='ExperimentId', description='Parameter name', example='440'),
        mfu?: double(name='Mfu', description='MFU', example='34'),
        samplesPerSecond?: double(name='SamplesPerSecond', description='Samples per second', example='10'),
        secondsPerIteration?: double(name='SecondsPerIteration', description='Seconds per iteration', example='89'),
        warningWorker?: [ 
          {
            errorFlag?: boolean(name='ErrorFlag', description='Whether there is an error', example='false'),
            errorMsg?: string(name='ErrorMsg', description='Error message', example='error msg'),
            experimentId?: long(name='ExperimentId', description='Experiment ID', example='113'),
            gpuName?: string(name='GpuName', description='GPU name', example='8x OAM 810 GPU'),
            gpuNum?: int32(name='GpuNum', description='Number of GPUs', example='90'),
            hostname?: string(name='Hostname', description='Host IP', example='101.66.165.102'),
            podName?: string(name='PodName', description='Pod name', example='hzs-forge-sdxl-online-7ff4d86444-pc95h'),
            samplesPerSecond?: double(name='SamplesPerSecond', description='Throughput', example='53'),
            tflops?: double(name='Tflops', description='TFLOPS value', example='43'),
            warningFlag?: boolean(name='WarningFlag', description='Whether there is an alarm', example='false'),
            warningMsg?: string(name='WarningMsg', description='Alarm message', example='warning msg'),
          }
        ](name='WarningWorker', description='Warning worker'),
      }(name='Results', description='Task results'),
      setParams?: map[string]string(name='SetParams', description='Load parameters in operation'),
      startTime?: string(name='StartTime', description='Task start time', example='2024-10-22 10:18:10'),
      status?: string(name='Status', description='Status', example='RUNNING'),
      updateTime?: long(name='UpdateTime', description='Update time', example='2024-10-22 10:18:10'),
      workloadName?: string(name='WorkloadName', description='Workload name', example='test'),
    }
  ](name='Data', description='Data'),
  requestId?: string(name='RequestId', description='Request ID', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', description='Total', example='0'),
}

model ListExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentsResponseBody(name='body'),
}

/**
 * @summary Query the experiment list based on the plan ID
 *
 * @param request ListExperimentsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentsResponse
 */
async function listExperimentsWithOptions(request: ListExperimentsRequest, runtime: Util.RuntimeOptions): ListExperimentsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperiments',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the experiment list based on the plan ID
 *
 * @param request ListExperimentsRequest
 * @return ListExperimentsResponse
 */
async function listExperiments(request: ListExperimentsRequest): ListExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listExperimentsWithOptions(request, runtime);
}

model ListWorkloadsRequest {
  scope?: string(name='Scope', example='common'),
}

model ListWorkloadsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: [ 
    {
      defaultCpuPerWorker?: int32(name='DefaultCpuPerWorker', example='90'),
      defaultGpuPerWorker?: int32(name='DefaultGpuPerWorker', example='8'),
      defaultMemoryPerWorker?: int32(name='DefaultMemoryPerWorker', example='500'),
      defaultShareMemory?: int32(name='DefaultShareMemory', example='500'),
      family?: string(name='Family', example='AI'),
      jobKind?: string(name='JobKind', example='PyTorchJob'),
      paramSettings?: [ 
        {
          defaultValue?: string(name='DefaultValue', example='100'),
          paramDesc?: string(name='ParamDesc'),
          paramName?: string(name='ParamName', example='ITERATION'),
          paramRegex?: string(name='ParamRegex', example='[0-9]+'),
          paramType?: string(name='ParamType', example='number'),
          paramValue?: string(name='ParamValue', example='100'),
        }
      ](name='ParamSettings'),
      scene?: string(name='Scene', example='NLP-LLM'),
      scope?: string(name='Scope', example='common'),
      staticConfig?: {
        frameWork?: string(name='FrameWork', example='PyTorch'),
        os?: string(name='Os', example='linux'),
        parameters?: string(name='Parameters', example='7B'),
        softwareStack?: string(name='SoftwareStack', example='python'),
      }(name='StaticConfig'),
      versionId?: long(name='VersionId', example='1'),
      workloadDescription?: string(name='WorkloadDescription', example='test'),
      workloadId?: long(name='WorkloadId', example='13'),
      workloadName?: string(name='WorkloadName', example='test'),
      workloadType?: string(name='WorkloadType', example='AI'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='4AC08332-436C-57A3-9FBA-26772B1A9901'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListWorkloadsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkloadsResponseBody(name='body'),
}

/**
 * @summary 获取负载列表
 *
 * @param request ListWorkloadsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkloadsResponse
 */
async function listWorkloadsWithOptions(request: ListWorkloadsRequest, runtime: Util.RuntimeOptions): ListWorkloadsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkloads',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取负载列表
 *
 * @param request ListWorkloadsRequest
 * @return ListWorkloadsResponse
 */
async function listWorkloads(request: ListWorkloadsRequest): ListWorkloadsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWorkloadsWithOptions(request, runtime);
}

model StopExperimentRequest {
  experimentId?: long(name='ExperimentId', example='234'),
}

model StopExperimentResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  data?: boolean(name='Data', example='true'),
  requestId?: string(name='RequestId', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', example='0'),
}

model StopExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopExperimentResponseBody(name='body'),
}

/**
 * @summary 停止实验
 *
 * @param request StopExperimentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopExperimentResponse
 */
async function stopExperimentWithOptions(request: StopExperimentRequest, runtime: Util.RuntimeOptions): StopExperimentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopExperiment',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 停止实验
 *
 * @param request StopExperimentRequest
 * @return StopExperimentResponse
 */
async function stopExperiment(request: StopExperimentRequest): StopExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopExperimentWithOptions(request, runtime);
}

model ValidateResourceRequest {
  clusterId?: string(name='ClusterId', description='Resource ID', example='ehpc-sh-ouypm5aucy'),
  userAccessParam?: {
    accessId?: string(name='AccessId', description='User ID', example='dev'),
    accessKey?: string(name='AccessKey', description='User Key', example='test'),
    endpoint?: string(name='Endpoint', description='Endpoint', example='test'),
    workspaceId?: string(name='WorkspaceId', description='Workspace ID', example='test'),
  }(name='UserAccessParam', description='User Authorization Parameters'),
}

model ValidateResourceShrinkRequest {
  clusterId?: string(name='ClusterId', description='Resource ID', example='ehpc-sh-ouypm5aucy'),
  userAccessParamShrink?: string(name='UserAccessParam', description='User Authorization Parameters'),
}

model ValidateResourceResponseBody = {
  data?: boolean(name='Data', description='Data', example='true'),
  requestId?: string(name='RequestId', description='Request Id', example='5514CB39-B7C0-5B89-8534-2DE1E0F2B7AB'),
  totalCount?: long(name='TotalCount', description='Total', example='0'),
}

model ValidateResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidateResourceResponseBody(name='body'),
}

/**
 * @summary Resource Connectivity Test
 *
 * @param tmpReq ValidateResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ValidateResourceResponse
 */
async function validateResourceWithOptions(tmpReq: ValidateResourceRequest, runtime: Util.RuntimeOptions): ValidateResourceResponse {
  Util.validateModel(tmpReq);
  var request = new ValidateResourceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.userAccessParam)) {
    request.userAccessParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userAccessParam, 'UserAccessParam', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.userAccessParamShrink)) {
    body['UserAccessParam'] = request.userAccessParamShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ValidateResource',
    version = '2023-08-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resource Connectivity Test
 *
 * @param request ValidateResourceRequest
 * @return ValidateResourceResponse
 */
async function validateResource(request: ValidateResourceRequest): ValidateResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return validateResourceWithOptions(request, runtime);
}

